#include<bits/stdc++.h>
using namespace std;

int n,a[100005],ans,m,f[100005],c[100005];

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]),f[a[i]]++;
    for(int i=1;i<=100000;i++)
    {
        if(!f[i]) continue;
        c[++m]=f[i];
    }
    int l=1,r=2;
    while(l<r&&r<=m)
    {
        if(c[l]<c[r])
        {
            c[l]=0;
            if(++l==r) r++;
        }
        else if(c[l]==c[r]) c[l++]=0,r++;
        else c[l]-=c[r],r++;
    }
    for(int i=1;i<=m;i++) ans+=c[i];
    cout<<ans;
    return 0;
}
// Code by Jorisy. Best Wishes & Good Luck.
